#include "stdafx.h"
#include <LitInitialiser.h>

namespace Lit
{
	Initialiser::Initialiser( const Initialiser &rk ) : Named(rk), mInitialised(rk.mInitialised){}
	Initialiser::Initialiser( const String &name ) : Named(name), mInitialised( false ){}
	Initialiser::~Initialiser( ){}

	void Initialiser::setInitialised( bool init ){ mInitialised = init ; }
	bool Initialiser::isInitialised( ) const{ return mInitialised; }
			
	Initialiser& Initialiser::operator=( const Initialiser &rk ){
		Named::operator=( rk );
		return *this; 
	}

	void Initialiser::throwNotInit( )
	{
		if( !isInitialised() )
			throw Lit::InitialisationError( mName + " not initialised !", EXC_LOC );
	}
	void Initialiser::throwAlreadyInit( )
	{
		if( isInitialised() )
			throw Lit::InitialisationError( mName + " already initialised !", EXC_LOC );
	}
};